import java.util.ArrayList;
import java.util.List;


public class ShoppingCart {
    private List<Fruit> fruits;

    public ShoppingCart() {
        fruits = new ArrayList<>();
    }

    public void addFruit(Fruit fruit) {
        fruits.add(fruit);
    }

    public double calculateTotalPrice() {
        double totalPrice = 0.0;
        for (Fruit fruit : fruits) {
            totalPrice += fruit.getTotalPrice();
        }
        return totalPrice;
    }
}
